<!DOCTYPE html>












  


<html class="theme-next gemini use-motion" lang="zh-CN">
<head><meta name="generator" content="Hexo 3.9.0">
  <!-- hexo-inject:begin --><!-- hexo-inject:end --><meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=2">
<meta name="theme-color" content="#222">












  <link rel="apple-touch-icon" sizes="180x180" href="/images/apple-touch-icon-next.png?v=7.2.0">


  <link rel="icon" type="image/png" sizes="32x32" href="/images/favicon-32x32-next.png?v=7.2.0">


  <link rel="icon" type="image/png" sizes="16x16" href="/images/favicon-16x16-next.png?v=7.2.0">


  <link rel="mask-icon" href="/images/logo.svg?v=7.2.0" color="#222">






<link rel="stylesheet" href="/css/main.css?v=7.2.0">






<link rel="stylesheet" href="/lib/font-awesome/css/font-awesome.min.css?v=4.7.0">








<script id="hexo.configurations">
  var NexT = window.NexT || {};
  var CONFIG = {
    root: '/',
    scheme: 'Gemini',
    version: '7.2.0',
    sidebar: {"position":"left","display":"post","offset":12,"onmobile":false},
    back2top: {"enable":true,"sidebar":false,"scrollpercent":false},
    copycode: {"enable":false,"show_result":false,"style":null},
    fancybox: false,
    mediumzoom: false,
    lazyload: false,
    pangu: false,
    algolia: {
      applicationID: '',
      apiKey: '',
      indexName: '',
      hits: {"per_page":10},
      labels: {"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}
    },
    localsearch: {"enable":false,"trigger":"auto","top_n_per_article":1,"unescape":false,"preload":false},
    search: {
      root: '/',
      path: ''
    },
    tabs: true,
    motion: {"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}},
    translation: {
      copy_button: '复制',
      copy_success: '复制成功',
      copy_failure: '复制失败'
    }
  };
</script>

  <meta name="description" content="I&apos;m a bluetooth Host and Controller developer">
<meta name="keywords" content="bluetooth, reading, thinking">
<meta property="og:type" content="website">
<meta property="og:title" content="Wen Wu&#39;s notes">
<meta property="og:url" content="http://yoursite.com/page/4/index.html">
<meta property="og:site_name" content="Wen Wu&#39;s notes">
<meta property="og:description" content="I&apos;m a bluetooth Host and Controller developer">
<meta property="og:locale" content="zh-CN">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="Wen Wu&#39;s notes">
<meta name="twitter:description" content="I&apos;m a bluetooth Host and Controller developer">





  
  
  <link rel="canonical" href="http://yoursite.com/page/4/">



<script id="page.configurations">
  CONFIG.page = {
    sidebar: "",
  };
</script>

  
  <title>Wen Wu's notes</title>
  












  <noscript>
  <style>
  .use-motion .motion-element,
  .use-motion .brand,
  .use-motion .menu-item,
  .sidebar-inner,
  .use-motion .post-block,
  .use-motion .pagination,
  .use-motion .comments,
  .use-motion .post-header,
  .use-motion .post-body,
  .use-motion .collection-title { opacity: initial; }

  .use-motion .logo,
  .use-motion .site-title,
  .use-motion .site-subtitle {
    opacity: initial;
    top: initial;
  }

  .use-motion .logo-line-before i { left: initial; }
  .use-motion .logo-line-after i { right: initial; }
  </style>
</noscript><!-- hexo-inject:begin --><!-- hexo-inject:end -->

</head>

<body itemscope itemtype="http://schema.org/WebPage" lang="zh-CN">

  
  
    
  

  <!-- hexo-inject:begin --><!-- hexo-inject:end --><div class="container sidebar-position-left 
  page-home">
    <div class="headband"></div>

    <header id="header" class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-wrapper">
  <div class="site-meta">
    

    <div class="custom-logo-site-title">
      <a href="/" class="brand" rel="start">
        <span class="logo-line-before"><i></i></span>
        <span class="site-title">Wen Wu's notes</span>
        <span class="logo-line-after"><i></i></span>
      </a>
    </div>
    
      
        <p class="site-subtitle">technical record</p>
      
    
    
  </div>

  <div class="site-nav-toggle">
    <button aria-label="切换导航栏">
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
    </button>
  </div>
</div>



<nav class="site-nav">
  
    <ul id="menu" class="menu">
      
        
        
        
          
          <li class="menu-item menu-item-home">

    
    
      
    

    

    <a href="/" rel="section"><i class="menu-item-icon fa fa-fw fa-home"></i> <br>首页</a>

  </li>
        
        
        
          
          <li class="menu-item menu-item-about">

    
    
      
    

    

    <a href="/about/" rel="section"><i class="menu-item-icon fa fa-fw fa-user"></i> <br>关于</a>

  </li>
        
        
        
          
          <li class="menu-item menu-item-tags">

    
    
      
    

    

    <a href="/tags/" rel="section"><i class="menu-item-icon fa fa-fw fa-tags"></i> <br>标签</a>

  </li>
        
        
        
          
          <li class="menu-item menu-item-categories">

    
    
      
    

    

    <a href="/categories/" rel="section"><i class="menu-item-icon fa fa-fw fa-th"></i> <br>分类</a>

  </li>
        
        
        
          
          <li class="menu-item menu-item-archives">

    
    
      
    

    

    <a href="/archives/" rel="section"><i class="menu-item-icon fa fa-fw fa-archive"></i> <br>归档</a>

  </li>
        
        
        
          
          <li class="menu-item menu-item-schedule">

    
    
      
    

    

    <a href="/schedule/" rel="section"><i class="menu-item-icon fa fa-fw fa-calendar"></i> <br>日程表</a>

  </li>
        
        
        
          
          <li class="menu-item menu-item-sitemap">

    
    
      
    

    

    <a href="/sitemap.xml" rel="section"><i class="menu-item-icon fa fa-fw fa-sitemap"></i> <br>站点地图</a>

  </li>

      
      
    </ul>
  

  

  
</nav>



</div>
    </header>

    


    <main id="main" class="main">
      <div class="main-inner">
        <div class="content-wrap">
          
            

          
          <div id="content" class="content">
            
  <section id="posts" class="posts-expand">
    
        

  
  
  

  

  <article class="post post-type-normal" itemscope itemtype="http://schema.org/Article">
  
  
  
  <div class="post-block">
    <link itemprop="mainEntityOfPage" href="http://yoursite.com/2020/01/27/vs-mac-cmd/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="name" content="Wen Wu">
      <meta itemprop="description" content="I'm a bluetooth Host and Controller developer">
      <meta itemprop="image" content="/images/avatar.gif">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="Wen Wu's notes">
    </span>

    
      <header class="post-header">

        
        
          <h1 class="post-title" itemprop="name headline">
                
                
                <a href="/2020/01/27/vs-mac-cmd/" class="post-title-link" itemprop="url">VC code 常用快捷键</a>
              
            
          </h1>
        

        <div class="post-meta">

          
          
          

          
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              
                <span class="post-meta-item-text">发表于</span>
              

              
                
              

              <time title="创建时间：2020-01-27 23:49:30" itemprop="dateCreated datePublished" datetime="2020-01-27T23:49:30+08:00">2020-01-27</time>
            </span>
          

          

          
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="fa fa-folder-o"></i>
              </span>
              
                <span class="post-meta-item-text">分类于</span>
              
              
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing"><a href="/categories/MAC/" itemprop="url" rel="index"><span itemprop="name">MAC</span></a></span>

                
                
              
            </span>
          

          
          
            <span id="/2020/01/27/vs-mac-cmd/" class="post-meta-item leancloud_visitors" data-flag-title="VC code 常用快捷键">
              <span class="post-meta-item-icon">
                <i class="fa fa-eye"></i>
              </span>
              
                <span class="post-meta-item-text">阅读次数：</span>
              
                <span class="leancloud-visitors-count"></span>
            </span>
          

          

          
            
  
  <span class="post-meta-item">
    
    <span class="post-meta-item-icon">
      <i class="fa fa-comment-o"></i>
    </span>
    
      <span class="post-meta-item-text">评论数：</span>
    
  
    <a href="/2020/01/27/vs-mac-cmd/#comments" itemprop="discussionUrl">
      <span class="post-comments-count valine-comment-count" data-xid="/2020/01/27/vs-mac-cmd/" itemprop="commentCount"></span>
    </a>
  </span>
  
  
          

          <br>
          

          

          

        </div>
      </header>
    

    
    
    
    <div class="post-body" itemprop="articleBody">

      
      

      
        
          
            <ol>
<li>进入函数 fn + F12</li>
<li>回到前一个光标点 control + -</li>
<li>查看函数引用 fn + shift + F12, 每多按一次这个组合就跳转一次到引用该函数的地方</li>
</ol>

          
        
      
    </div>

    

    

    
    
    

    

    
      
    
    

    

    <footer class="post-footer">
      

      

      

      
      
        <div class="post-eof"></div>
      
    </footer>
  </div>
  
  
  
  </article>

    
        

  
  
  

  

  <article class="post post-type-normal" itemscope itemtype="http://schema.org/Article">
  
  
  
  <div class="post-block">
    <link itemprop="mainEntityOfPage" href="http://yoursite.com/2020/01/12/nimble-adv/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="name" content="Wen Wu">
      <meta itemprop="description" content="I'm a bluetooth Host and Controller developer">
      <meta itemprop="image" content="/images/avatar.gif">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="Wen Wu's notes">
    </span>

    
      <header class="post-header">

        
        
          <h1 class="post-title" itemprop="name headline">
                
                
                <a href="/2020/01/12/nimble-adv/" class="post-title-link" itemprop="url">nimble advertising</a>
              
            
          </h1>
        

        <div class="post-meta">

          
          
          

          
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              
                <span class="post-meta-item-text">发表于</span>
              

              
                
              

              <time title="创建时间：2020-01-12 13:21:55" itemprop="dateCreated datePublished" datetime="2020-01-12T13:21:55+08:00">2020-01-12</time>
            </span>
          

          
            

            
              <span class="post-meta-item">
                <span class="post-meta-item-icon">
                  <i class="fa fa-calendar-check-o"></i>
                </span>
                
                  <span class="post-meta-item-text">更新于</span>
                
                <time title="修改时间：2020-01-19 23:51:55" itemprop="dateModified" datetime="2020-01-19T23:51:55+08:00">2020-01-19</time>
              </span>
            
          

          
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="fa fa-folder-o"></i>
              </span>
              
                <span class="post-meta-item-text">分类于</span>
              
              
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing"><a href="/categories/Nimble/" itemprop="url" rel="index"><span itemprop="name">Nimble</span></a></span>

                
                
              
            </span>
          

          
          
            <span id="/2020/01/12/nimble-adv/" class="post-meta-item leancloud_visitors" data-flag-title="nimble advertising">
              <span class="post-meta-item-icon">
                <i class="fa fa-eye"></i>
              </span>
              
                <span class="post-meta-item-text">阅读次数：</span>
              
                <span class="leancloud-visitors-count"></span>
            </span>
          

          

          
            
  
  <span class="post-meta-item">
    
    <span class="post-meta-item-icon">
      <i class="fa fa-comment-o"></i>
    </span>
    
      <span class="post-meta-item-text">评论数：</span>
    
  
    <a href="/2020/01/12/nimble-adv/#comments" itemprop="discussionUrl">
      <span class="post-comments-count valine-comment-count" data-xid="/2020/01/12/nimble-adv/" itemprop="commentCount"></span>
    </a>
  </span>
  
  
          

          <br>
          

          

          

        </div>
      </header>
    

    
    
    
    <div class="post-body" itemprop="articleBody">

      
      

      
        
          
            <p>今天顺利将美人鱼（<a href="https://mermaid-js.github.io/mermaid/#/">Mermaid</a>）插件装上，整理一张时序图：</p>
<pre class="mermaid">sequenceDiagram
NPL->>HCI:BLE_HCI_OCF_LE_SET_ADV_ENABLE
HCI->>HCI:ble_ll_hci_cmd_proc()
HCI->>ADV: ble_ll_hci_adv_set_enable()
note over ADV: ble_ll_adv_sm_start()
ADV->>Scheduler: ble_ll_sched_adv_new()
Scheduler->>Scheduler: ble_ll_sched_run()
note over Scheduler: ble_ll_sched_execute_item()
Scheduler->>ADV: ble_ll_adv_tx_start_cb()
ADV->>PHY: ble_phy_tx()
PHY->>ADV: ble_ll_adv_tx_done()
ADV->>NPL: adv_txdone_ev
NPL->>ADV: ble_ll_adv_event_done()
note over ADV: ble_ll_adv_done()
note over ADV: ble_ll_adv_reschedule_event()
ADV-->>Scheduler: ble_ll_sched_adv_reschedule()
RADIO->>PHY: RADIO_IRQn
note over PHY: ble_phy_isr()
note over PHY: ble_phy_rx_start_isr()
PHY->>ADV: ble_ll_adv_rx_isr_start()
note over PHY: ble_phy_rx_end_isr()
PHY->>ADV: ble_ll_adv_rx_isr_end()
note over ADV: ble_ll_adv_rx_req()
ADV->>PHY:ble_phy_tx(ble_ll_adv_scan_rsp_legacy_pdu_make)
NPL->>LL: ble_ll_event_rx_pkt()
LL->>LL: ble_ll_rx_pkt_in()
LL->>ADV: ble_ll_adv_rx_pkt_in()
note over ADV: ble_ll_adv_conn_req_rxd()
ADV->>CONN: ble_ll_conn_slave_start()
note over ADV: ble_ll_adv_sm_stop()
note over CONN: ble_ll_conn_created()
CONN->>Scheduler:ble_ll_sched_slave_new()
note over CONN: ble_ll_conn_next_event()</pre>

          
        
      
    </div>

    

    

    
    
    

    

    
      
    
    

    

    <footer class="post-footer">
      

      

      

      
      
        <div class="post-eof"></div>
      
    </footer>
  </div>
  
  
  
  </article>

    
        

  
  
  

  

  <article class="post post-type-normal" itemscope itemtype="http://schema.org/Article">
  
  
  
  <div class="post-block">
    <link itemprop="mainEntityOfPage" href="http://yoursite.com/2020/01/11/why-fpga/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="name" content="Wen Wu">
      <meta itemprop="description" content="I'm a bluetooth Host and Controller developer">
      <meta itemprop="image" content="/images/avatar.gif">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="Wen Wu's notes">
    </span>

    
      <header class="post-header">

        
        
          <h1 class="post-title" itemprop="name headline">
                
                
                <a href="/2020/01/11/why-fpga/" class="post-title-link" itemprop="url">为什么要用FPGA</a>
              
            
          </h1>
        

        <div class="post-meta">

          
          
          

          
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              
                <span class="post-meta-item-text">发表于</span>
              

              
                
              

              <time title="创建时间：2020-01-11 10:48:54" itemprop="dateCreated datePublished" datetime="2020-01-11T10:48:54+08:00">2020-01-11</time>
            </span>
          

          

          

          
          
            <span id="/2020/01/11/why-fpga/" class="post-meta-item leancloud_visitors" data-flag-title="为什么要用FPGA">
              <span class="post-meta-item-icon">
                <i class="fa fa-eye"></i>
              </span>
              
                <span class="post-meta-item-text">阅读次数：</span>
              
                <span class="leancloud-visitors-count"></span>
            </span>
          

          

          
            
  
  <span class="post-meta-item">
    
    <span class="post-meta-item-icon">
      <i class="fa fa-comment-o"></i>
    </span>
    
      <span class="post-meta-item-text">评论数：</span>
    
  
    <a href="/2020/01/11/why-fpga/#comments" itemprop="discussionUrl">
      <span class="post-comments-count valine-comment-count" data-xid="/2020/01/11/why-fpga/" itemprop="commentCount"></span>
    </a>
  </span>
  
  
          

          <br>
          

          

          

        </div>
      </header>
    

    
    
    
    <div class="post-body" itemprop="articleBody">

      
      

      
        
          
            <p>为什么要用FPGA，<a href="https://zhuanlan.zhihu.com/p/70638655">Link</a></p>

          
        
      
    </div>

    

    

    
    
    

    

    
      
    
    

    

    <footer class="post-footer">
      

      

      

      
      
        <div class="post-eof"></div>
      
    </footer>
  </div>
  
  
  
  </article>

    
        

  
  
  

  

  <article class="post post-type-normal" itemscope itemtype="http://schema.org/Article">
  
  
  
  <div class="post-block">
    <link itemprop="mainEntityOfPage" href="http://yoursite.com/2020/01/09/git-remote-folder/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="name" content="Wen Wu">
      <meta itemprop="description" content="I'm a bluetooth Host and Controller developer">
      <meta itemprop="image" content="/images/avatar.gif">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="Wen Wu's notes">
    </span>

    
      <header class="post-header">

        
        
          <h1 class="post-title" itemprop="name headline">
                
                
                <a href="/2020/01/09/git-remote-folder/" class="post-title-link" itemprop="url">将本地文件夹push到github</a>
              
            
          </h1>
        

        <div class="post-meta">

          
          
          

          
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              
                <span class="post-meta-item-text">发表于</span>
              

              
                
              

              <time title="创建时间：2020-01-09 00:05:58" itemprop="dateCreated datePublished" datetime="2020-01-09T00:05:58+08:00">2020-01-09</time>
            </span>
          

          

          
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="fa fa-folder-o"></i>
              </span>
              
                <span class="post-meta-item-text">分类于</span>
              
              
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing"><a href="/categories/GIT/" itemprop="url" rel="index"><span itemprop="name">GIT</span></a></span>

                
                
              
            </span>
          

          
          
            <span id="/2020/01/09/git-remote-folder/" class="post-meta-item leancloud_visitors" data-flag-title="将本地文件夹push到github">
              <span class="post-meta-item-icon">
                <i class="fa fa-eye"></i>
              </span>
              
                <span class="post-meta-item-text">阅读次数：</span>
              
                <span class="leancloud-visitors-count"></span>
            </span>
          

          

          
            
  
  <span class="post-meta-item">
    
    <span class="post-meta-item-icon">
      <i class="fa fa-comment-o"></i>
    </span>
    
      <span class="post-meta-item-text">评论数：</span>
    
  
    <a href="/2020/01/09/git-remote-folder/#comments" itemprop="discussionUrl">
      <span class="post-comments-count valine-comment-count" data-xid="/2020/01/09/git-remote-folder/" itemprop="commentCount"></span>
    </a>
  </span>
  
  
          

          <br>
          

          

          

        </div>
      </header>
    

    
    
    
    <div class="post-body" itemprop="articleBody">

      
      

      
        
          
            <ol>
<li><p>进入文件夹，git init 把这个目录变成git可以管理的仓库</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">git init</span><br></pre></td></tr></table></figure>
</li>
<li><p>把文件添加到版本库中，使用命令 git add . 添加到暂存区里面去，不要忘记后面的小数点“.”，意为添加文件夹下的所有文件</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">git add .</span><br></pre></td></tr></table></figure>
</li>
<li><p>用命令 git commit告诉Git，把文件提交到仓库。引号内为提交说明</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">git commit -m &apos;first version&apos;</span><br></pre></td></tr></table></figure>
</li>
<li><p>关联到远程库</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">git remote add origin https://github.com/reponame.git</span><br></pre></td></tr></table></figure>
</li>
<li><p>把本地库的内容推送到远程，使用 git push命令，实际上是把当前分支master推送到远程。执行此命令后会要求输入用户名、密码，验证通过后即开始上传。</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">git push -u origin master</span><br></pre></td></tr></table></figure>
</li>
</ol>

          
        
      
    </div>

    

    

    
    
    

    

    
      
    
    

    

    <footer class="post-footer">
      

      

      

      
      
        <div class="post-eof"></div>
      
    </footer>
  </div>
  
  
  
  </article>

    
        

  
  
  

  

  <article class="post post-type-normal" itemscope itemtype="http://schema.org/Article">
  
  
  
  <div class="post-block">
    <link itemprop="mainEntityOfPage" href="http://yoursite.com/2020/01/06/dance-music/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="name" content="Wen Wu">
      <meta itemprop="description" content="I'm a bluetooth Host and Controller developer">
      <meta itemprop="image" content="/images/avatar.gif">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="Wen Wu's notes">
    </span>

    
      <header class="post-header">

        
        
          <h1 class="post-title" itemprop="name headline">
                
                
                <a href="/2020/01/06/dance-music/" class="post-title-link" itemprop="url">舞曲</a>
              
            
          </h1>
        

        <div class="post-meta">

          
          
          

          
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              
                <span class="post-meta-item-text">发表于</span>
              

              
                
              

              <time title="创建时间：2020-01-06 08:19:56" itemprop="dateCreated datePublished" datetime="2020-01-06T08:19:56+08:00">2020-01-06</time>
            </span>
          

          
            

            
              <span class="post-meta-item">
                <span class="post-meta-item-icon">
                  <i class="fa fa-calendar-check-o"></i>
                </span>
                
                  <span class="post-meta-item-text">更新于</span>
                
                <time title="修改时间：2020-03-31 22:30:55" itemprop="dateModified" datetime="2020-03-31T22:30:55+08:00">2020-03-31</time>
              </span>
            
          

          
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="fa fa-folder-o"></i>
              </span>
              
                <span class="post-meta-item-text">分类于</span>
              
              
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing"><a href="/categories/Dance/" itemprop="url" rel="index"><span itemprop="name">Dance</span></a></span>

                
                
              
            </span>
          

          
          
            <span id="/2020/01/06/dance-music/" class="post-meta-item leancloud_visitors" data-flag-title="舞曲">
              <span class="post-meta-item-icon">
                <i class="fa fa-eye"></i>
              </span>
              
                <span class="post-meta-item-text">阅读次数：</span>
              
                <span class="leancloud-visitors-count"></span>
            </span>
          

          

          
            
  
  <span class="post-meta-item">
    
    <span class="post-meta-item-icon">
      <i class="fa fa-comment-o"></i>
    </span>
    
      <span class="post-meta-item-text">评论数：</span>
    
  
    <a href="/2020/01/06/dance-music/#comments" itemprop="discussionUrl">
      <span class="post-comments-count valine-comment-count" data-xid="/2020/01/06/dance-music/" itemprop="commentCount"></span>
    </a>
  </span>
  
  
          

          <br>
          

          

          

        </div>
      </header>
    

    
    
    
    <div class="post-body" itemprop="articleBody">

      
      

      
        
          
            <p>几段喜欢的音乐，如有侵权，请随时通知。</p>
<ol>
<li><p><a href="https://wnnwoo.oss-cn-chengdu.aliyuncs.com/Dance/%E6%A2%86%E6%A2%86%E8%88%9E%EF%BC%88%E5%85%A8%EF%BC%89.wav">《邦邦舞》</a></p>
<blockquote>
<p>“哦嘛哩嘛嘞，邦邦”<br>简单欢快，不知道是哪个国家舞蹈。</p>
</blockquote>
</li>
<li><p><a href="https://wnnwoo.oss-cn-chengdu.aliyuncs.com/Dance/%E5%A5%94%E8%85%BE.mp3">《奔腾》</a></p>
<blockquote>
<p>快板、慢板、快板三段，中间慢板最美，柔中带刚，刚中带柔，有一种飘来飘去的感觉。<br>一直没搞清楚奔腾的到底是骏马？还是套马的汉子？</p>
</blockquote>
</li>
<li><p><a href="https://wnnwoo.oss-cn-chengdu.aliyuncs.com/Dance/%7BMerengue%7D%2001.mp3">《Merengue》</a></p>
<blockquote>
<p>也算是一个拉丁舞种。</p>
</blockquote>
</li>
<li><p><a href="https://wnnwoo.oss-cn-chengdu.aliyuncs.com/Dance/%E5%87%BA%E8%B5%B0.mp3">《出走》</a></p>
<blockquote>
<p>改编自腾格尔的歌曲，刘福洋和万玛尖措表演，表达两兄弟来开草原时恋恋不舍的内心。</p>
</blockquote>
</li>
<li><p><a href="https://wnnwoo.oss-cn-chengdu.aliyuncs.com/Dance/santa%20maria.mp3">《Santa maria》</a></p>
<blockquote>
<p>探戈。</p>
</blockquote>
</li>
</ol>
<p>作为一个节奏控，跑步必须有鼓点，要不就跑不起来。下面几个蒙古神曲，伴我每天跑过5km</p>
<ol>
<li><p><a href="https://y.qq.com/n/yqq/song/003GAux10MQHrm.html">《希格希日》</a></p>
<blockquote>
<p>先来个慢走，7km/h</p>
</blockquote>
</li>
<li><p><a href="https://y.qq.com/n/yqq/song/0034FYb51q77gz.html">《丝路的随想》</a></p>
<blockquote>
<p>非常热闹，就是歌曲名有点土气。</p>
</blockquote>
</li>
<li><p><a href="https://y.qq.com/n/yqq/song/002tKITj17ARk6.html">《吆呼儿》</a></p>
<blockquote>
<p>之前看节目的时候听到过一次，一直不知道名字，终于找到了，刚好搭配11km/h</p>
</blockquote>
</li>
</ol>

          
        
      
    </div>

    

    

    
    
    

    

    
      
    
    

    

    <footer class="post-footer">
      

      

      

      
      
        <div class="post-eof"></div>
      
    </footer>
  </div>
  
  
  
  </article>

    
        

  
  
  

  

  <article class="post post-type-normal" itemscope itemtype="http://schema.org/Article">
  
  
  
  <div class="post-block">
    <link itemprop="mainEntityOfPage" href="http://yoursite.com/2020/01/05/nimble-scheduler/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="name" content="Wen Wu">
      <meta itemprop="description" content="I'm a bluetooth Host and Controller developer">
      <meta itemprop="image" content="/images/avatar.gif">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="Wen Wu's notes">
    </span>

    
      <header class="post-header">

        
        
          <h1 class="post-title" itemprop="name headline">
                
                
                <a href="/2020/01/05/nimble-scheduler/" class="post-title-link" itemprop="url">Nimble scheduler</a>
              
            
          </h1>
        

        <div class="post-meta">

          
          
          

          
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              
                <span class="post-meta-item-text">发表于</span>
              

              
                
              

              <time title="创建时间：2020-01-05 22:26:36" itemprop="dateCreated datePublished" datetime="2020-01-05T22:26:36+08:00">2020-01-05</time>
            </span>
          

          
            

            
              <span class="post-meta-item">
                <span class="post-meta-item-icon">
                  <i class="fa fa-calendar-check-o"></i>
                </span>
                
                  <span class="post-meta-item-text">更新于</span>
                
                <time title="修改时间：2020-01-19 22:26:36" itemprop="dateModified" datetime="2020-01-19T22:26:36+08:00">2020-01-19</time>
              </span>
            
          

          
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="fa fa-folder-o"></i>
              </span>
              
                <span class="post-meta-item-text">分类于</span>
              
              
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing"><a href="/categories/Nimble/" itemprop="url" rel="index"><span itemprop="name">Nimble</span></a></span>

                
                
              
            </span>
          

          
          
            <span id="/2020/01/05/nimble-scheduler/" class="post-meta-item leancloud_visitors" data-flag-title="Nimble scheduler">
              <span class="post-meta-item-icon">
                <i class="fa fa-eye"></i>
              </span>
              
                <span class="post-meta-item-text">阅读次数：</span>
              
                <span class="leancloud-visitors-count"></span>
            </span>
          

          

          
            
  
  <span class="post-meta-item">
    
    <span class="post-meta-item-icon">
      <i class="fa fa-comment-o"></i>
    </span>
    
      <span class="post-meta-item-text">评论数：</span>
    
  
    <a href="/2020/01/05/nimble-scheduler/#comments" itemprop="discussionUrl">
      <span class="post-comments-count valine-comment-count" data-xid="/2020/01/05/nimble-scheduler/" itemprop="commentCount"></span>
    </a>
  </span>
  
  
          

          <br>
          

          

          

        </div>
      </header>
    

    
    
    
    <div class="post-body" itemprop="articleBody">

      
      

      
        
          
            <p><strong>Nimble controller</strong> 的Scheduler是由一个32K的timer来驱动的，一个tick是30.52us，完全执行在timer的isr里，所以timer callback里要做的事情不能太耗时（超过一个tick），否则scheduler就不准确了，如下为scheduler的主函数：<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">/* Initialize cputimer for the scheduler */</span><br><span class="line">   os_cputime_timer_init(&amp;g_ble_ll_sched_timer, ble_ll_sched_run, NULL);</span><br></pre></td></tr></table></figure></p>
<h3 id="时间单位"><a href="#时间单位" class="headerlink" title="时间单位"></a>时间单位</h3><ul>
<li>Tick：由clock决定，对于32K clock来说，一个tick就是 1000000us/（32*1024） = 30.52us.</li>
<li>Slot：1250个毫秒</li>
<li>Period：N * Slot，N是可配置的</li>
<li>Epoch：M * Period，M是可配置的<br>Scheduler在调度的时候，有时要将Connection event放在Period的边界，scanning/initiating/advertising是尽可能发生在没有被用到的Period内。<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">/* Time per BLE scheduler slot */</span><br><span class="line">#define BLE_LL_SCHED_USECS_PER_SLOT         (1250)</span><br><span class="line">#define BLE_LL_SCHED_32KHZ_TICKS_PER_SLOT   (41)    /* 1 tick = 30.517 usecs */</span><br></pre></td></tr></table></figure>
</li>
</ul>
<h3 id="调度单位"><a href="#调度单位" class="headerlink" title="调度单位"></a>调度单位</h3><p>每一个可被调度的单位叫做Sched item,  这些item放在FIFO的List中，每当timer到期后Scheduler就从List里拉一个出来做执行。<br>每一个item有如下几个属性：</p>
<blockquote>
<ol>
<li>schedule type，类型</li>
<li>enquened，是否入Q，入Q就代表是Ready，等待被执行</li>
<li>remainder，剩余的执行时间</li>
<li>start_time, 开始执行时间</li>
<li>end_time, 结束执行时间</li>
<li>cb_args, item执行函数的参数</li>
<li>sched_cb, item被调度到的时候的执行函数<br>如下是相关的code segment <figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br></pre></td><td class="code"><pre><span class="line">struct ble_ll_sched_item</span><br><span class="line">&#123;</span><br><span class="line">    uint8_t         sched_type;</span><br><span class="line">    uint8_t         enqueued;</span><br><span class="line">    uint8_t         remainder;</span><br><span class="line">    uint32_t        start_time;</span><br><span class="line">    uint32_t        end_time;</span><br><span class="line">    void            *cb_arg;</span><br><span class="line">    sched_cb_func   sched_cb;</span><br><span class="line">    TAILQ_ENTRY(ble_ll_sched_item) link;</span><br><span class="line">&#125;;</span><br><span class="line"></span><br><span class="line">/* Types of scheduler events */</span><br><span class="line">#define BLE_LL_SCHED_TYPE_ADV       (1)</span><br><span class="line">#define BLE_LL_SCHED_TYPE_SCAN      (2)</span><br><span class="line">#define BLE_LL_SCHED_TYPE_CONN      (3)</span><br><span class="line">#define BLE_LL_SCHED_TYPE_AUX_SCAN  (4)</span><br><span class="line">#define BLE_LL_SCHED_TYPE_DTM       (5)</span><br><span class="line">#define BLE_LL_SCHED_TYPE_PERIODIC  (6)</span><br><span class="line">#define BLE_LL_SCHED_TYPE_SYNC      (7)</span><br></pre></td></tr></table></figure>
</li>
</ol>
</blockquote>
<h3 id="调度原则"><a href="#调度原则" class="headerlink" title="调度原则"></a>调度原则</h3><ol>
<li>Sched item之间没有优先级的关系，完全按照Sched item的start_time为序，一个一个的执行。</li>
<li>调度到某个item时就直接执行这个item的sched_cb，并将这个item从调度列表上删掉，callback执行完后，再起timer，等待下一个item的start_time到期。</li>
<li>item在插入到调度列表的时候就已经排好序了。</li>
<li>在插入新的Adv Sched item的时候，新的Adv要避开每一个跟他有overlap的item，直到找到一个完全跟它没有overlap的位置，这意味着在有同样的start time的情况下，先入list的优先级高。<blockquote>
<ul>
<li>以插入一个Adv Schedule为例，假如Scheduler的ReadyList里有4个item，它们的排列如下。那么下图中绿色的item就是可以直接插入的item，而红色的item则需要一直往后移动，一直移到一个能插入&gt;的地方，也许到list最后才能有它的一席之地。<br><img src="https://wnnwoo.oss-cn-chengdu.aliyuncs.com/Nimble/Nimble-Schedule-Adv-new.png" alt></li>
<li>在一个adv event执行完成后，需要再计算下一个adv event起来的时间，请参考下图。<br>Item中的<strong>Delay</strong>（0～10ms）指的是这个adv event最大允许delay的时间。<br><img src="https://wnnwoo.oss-cn-chengdu.aliyuncs.com/Nimble/Nimble-Schedule-Adv-Reschedule.png" alt></li>
</ul>
</blockquote>
</li>
<li>但是对于type为CONN的Sched是有点优先级的<blockquote>
<ul>
<li>正在execute的type为CONN的Sched的优先级最高，要新建立的conn的sched (ble_ll_sched_slave_new())如果刚好跟正在execute的conn overlap，那直接就取消新的这个conn。<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line">/* The schedule item must occur after current running item (if any) */</span><br><span class="line">  if (ble_ll_sched_overlaps_current(sch)) &#123;</span><br><span class="line">      OS_EXIT_CRITICAL(sr);</span><br><span class="line">      return rc;</span><br><span class="line">  &#125;</span><br></pre></td></tr></table></figure>
</li>
</ul>
</blockquote>
</li>
</ol>
<blockquote>
<ul>
<li>在收到CONN_IND的时候，为了能尽快在windowOffset到达时发包出去回应对方，会将跟他overlap的type为CONN的sched 给盖掉</li>
<li>但这包如果type是其他的type，则会继续往后shift找合适的位置，但如果是回应CONN_IND的第一包的话，不在规定时间发包出去，link就建立不起来，这里还是有点问题。<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line">if (ble_ll_sched_is_overlap(sch, entry)) &#123;</span><br><span class="line">    /* If we overlap with a connection, we re-schedule */</span><br><span class="line">    if (ble_ll_sched_conn_overlap(entry)) &#123;</span><br><span class="line">        break;</span><br><span class="line">    &#125;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>
</li>
</ul>
</blockquote>
<h3 id="更正-4"><a href="#更正-4" class="headerlink" title="更正 #4"></a>更正 #4</h3><p>感谢<a href="https://jaydenh215.github.io">jaydenh215</a>的指导，上图中关于Adv reschedule的图例欠妥，正确的符合code行为的插入Sched的示意图如下。<br><img src="https://wnnwoo.oss-cn-chengdu.aliyuncs.com/Nimble/Nimble-Schedule-Adv-Reschedule4.png" alt><br>如果超过了max_delay,那插入也是失败的，如下图，虽然在#3的前面有位置给sch插入，但是因为overdue了，所以插入会失败。<br><img src="https://wnnwoo.oss-cn-chengdu.aliyuncs.com/Nimble/Nimble-Schedule-Adv-Reschedule5.png" alt></p>

          
        
      
    </div>

    

    

    
    
    

    

    
      
    
    

    

    <footer class="post-footer">
      

      

      

      
      
        <div class="post-eof"></div>
      
    </footer>
  </div>
  
  
  
  </article>

    
        

  
  
  

  

  <article class="post post-type-normal" itemscope itemtype="http://schema.org/Article">
  
  
  
  <div class="post-block">
    <link itemprop="mainEntityOfPage" href="http://yoursite.com/2020/01/05/markdown-online/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="name" content="Wen Wu">
      <meta itemprop="description" content="I'm a bluetooth Host and Controller developer">
      <meta itemprop="image" content="/images/avatar.gif">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="Wen Wu's notes">
    </span>

    
      <header class="post-header">

        
        
          <h1 class="post-title" itemprop="name headline">
                
                
                <a href="/2020/01/05/markdown-online/" class="post-title-link" itemprop="url">markdown在线编辑</a>
              
            
          </h1>
        

        <div class="post-meta">

          
          
          

          
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              
                <span class="post-meta-item-text">发表于</span>
              

              
                
              

              <time title="创建时间：2020-01-05 11:10:33" itemprop="dateCreated datePublished" datetime="2020-01-05T11:10:33+08:00">2020-01-05</time>
            </span>
          

          

          
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="fa fa-folder-o"></i>
              </span>
              
                <span class="post-meta-item-text">分类于</span>
              
              
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing"><a href="/categories/Markdown/" itemprop="url" rel="index"><span itemprop="name">Markdown</span></a></span>

                
                
              
            </span>
          

          
          
            <span id="/2020/01/05/markdown-online/" class="post-meta-item leancloud_visitors" data-flag-title="markdown在线编辑">
              <span class="post-meta-item-icon">
                <i class="fa fa-eye"></i>
              </span>
              
                <span class="post-meta-item-text">阅读次数：</span>
              
                <span class="leancloud-visitors-count"></span>
            </span>
          

          

          
            
  
  <span class="post-meta-item">
    
    <span class="post-meta-item-icon">
      <i class="fa fa-comment-o"></i>
    </span>
    
      <span class="post-meta-item-text">评论数：</span>
    
  
    <a href="/2020/01/05/markdown-online/#comments" itemprop="discussionUrl">
      <span class="post-comments-count valine-comment-count" data-xid="/2020/01/05/markdown-online/" itemprop="commentCount"></span>
    </a>
  </span>
  
  
          

          <br>
          

          

          

        </div>
      </header>
    

    
    
    
    <div class="post-body" itemprop="articleBody">

      
      

      
        
          
            <p>   直接用VI写markdown，然后用Hexo去preview有点太麻烦了，找到几个比较棒的在线编辑markdown的网站 ，非常方便，效率提升十倍。</p>
<blockquote>
<ul>
<li><a href="https://maxiang.io">马克飞象</a></li>
<li><a href="http://mahua.jser.me">muhua</a></li>
<li><a href="https://www.mdeditor.com">mdeditor</a></li>
<li><a href="https://www.zybuluo.com/mdeditor">作业部落</a></li>
</ul>
</blockquote>
<p>或者干脆直接用印象笔记自带的markdown编辑器。</p>

          
        
      
    </div>

    

    

    
    
    

    

    
      
    
    

    

    <footer class="post-footer">
      

      

      

      
      
        <div class="post-eof"></div>
      
    </footer>
  </div>
  
  
  
  </article>

    
        

  
  
  

  

  <article class="post post-type-normal" itemscope itemtype="http://schema.org/Article">
  
  
  
  <div class="post-block">
    <link itemprop="mainEntityOfPage" href="http://yoursite.com/2020/01/04/nimble/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="name" content="Wen Wu">
      <meta itemprop="description" content="I'm a bluetooth Host and Controller developer">
      <meta itemprop="image" content="/images/avatar.gif">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="Wen Wu's notes">
    </span>

    
      <header class="post-header">

        
        
          <h1 class="post-title" itemprop="name headline">
                
                
                <a href="/2020/01/04/nimble/" class="post-title-link" itemprop="url">Nimble 初探</a>
              
            
          </h1>
        

        <div class="post-meta">

          
          
          

          
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              
                <span class="post-meta-item-text">发表于</span>
              

              
                
              

              <time title="创建时间：2020-01-04 00:20:12" itemprop="dateCreated datePublished" datetime="2020-01-04T00:20:12+08:00">2020-01-04</time>
            </span>
          

          

          
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="fa fa-folder-o"></i>
              </span>
              
                <span class="post-meta-item-text">分类于</span>
              
              
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing"><a href="/categories/Nimble/" itemprop="url" rel="index"><span itemprop="name">Nimble</span></a></span>

                
                
              
            </span>
          

          
          
            <span id="/2020/01/04/nimble/" class="post-meta-item leancloud_visitors" data-flag-title="Nimble 初探">
              <span class="post-meta-item-icon">
                <i class="fa fa-eye"></i>
              </span>
              
                <span class="post-meta-item-text">阅读次数：</span>
              
                <span class="leancloud-visitors-count"></span>
            </span>
          

          

          
            
  
  <span class="post-meta-item">
    
    <span class="post-meta-item-icon">
      <i class="fa fa-comment-o"></i>
    </span>
    
      <span class="post-meta-item-text">评论数：</span>
    
  
    <a href="/2020/01/04/nimble/#comments" itemprop="discussionUrl">
      <span class="post-comments-count valine-comment-count" data-xid="/2020/01/04/nimble/" itemprop="commentCount"></span>
    </a>
  </span>
  
  
          

          <br>
          

          

          

        </div>
      </header>
    

    
    
    
    <div class="post-body" itemprop="articleBody">

      
      

      
        
          
            <p>   在去年11月参加<a href="https://www.rt-thread.org">RTT</a>的开发者大会的时候得闻RTT目前在用<a href="https://github.com/apache/mynewt-nimble">Nimble</a>做为BLE stack，两年前我有看到过这个东西，当时觉得这种比较关键的技术一般来说开源的都不是比较好的东西，比较有竞争力的部分比如high performance、small footprint(<a href="https://github.com/apache/mynewt-nimble/issues/689">有人抱怨nimble吃RAM太大</a>)、low power等一般都不会开出来，所以也没有仔细研读过。今年由于工作的重心也转到了BT Controller，所以得好好研读下Nimble的source code，先纠正一个<a href="https://github.com/apache/mynewt-nimble/commit/3f373f3eaa3de4d78efc3b01199fde21fa27ecfe">小小的错误</a>，作为一个开始。<br>   这里有一<a href="https://www.youtube.com/watch?v=TiIxC1QbZ3k">video</a>介绍为啥要有nimble。</p>

          
        
      
    </div>

    

    

    
    
    

    

    
      
    
    

    

    <footer class="post-footer">
      

      

      

      
      
        <div class="post-eof"></div>
      
    </footer>
  </div>
  
  
  
  </article>

    
        

  
  
  

  

  <article class="post post-type-normal" itemscope itemtype="http://schema.org/Article">
  
  
  
  <div class="post-block">
    <link itemprop="mainEntityOfPage" href="http://yoursite.com/2020/01/04/aliyun/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="name" content="Wen Wu">
      <meta itemprop="description" content="I'm a bluetooth Host and Controller developer">
      <meta itemprop="image" content="/images/avatar.gif">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="Wen Wu's notes">
    </span>

    
      <header class="post-header">

        
        
          <h1 class="post-title" itemprop="name headline">
                
                
                <a href="/2020/01/04/aliyun/" class="post-title-link" itemprop="url">阿里云使用</a>
              
            
          </h1>
        

        <div class="post-meta">

          
          
          

          
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              
                <span class="post-meta-item-text">发表于</span>
              

              
                
              

              <time title="创建时间：2020-01-04 00:19:53" itemprop="dateCreated datePublished" datetime="2020-01-04T00:19:53+08:00">2020-01-04</time>
            </span>
          

          

          
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="fa fa-folder-o"></i>
              </span>
              
                <span class="post-meta-item-text">分类于</span>
              
              
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing"><a href="/categories/阿里云/" itemprop="url" rel="index"><span itemprop="name">阿里云</span></a></span>

                
                
              
            </span>
          

          
          
            <span id="/2020/01/04/aliyun/" class="post-meta-item leancloud_visitors" data-flag-title="阿里云使用">
              <span class="post-meta-item-icon">
                <i class="fa fa-eye"></i>
              </span>
              
                <span class="post-meta-item-text">阅读次数：</span>
              
                <span class="leancloud-visitors-count"></span>
            </span>
          

          

          
            
  
  <span class="post-meta-item">
    
    <span class="post-meta-item-icon">
      <i class="fa fa-comment-o"></i>
    </span>
    
      <span class="post-meta-item-text">评论数：</span>
    
  
    <a href="/2020/01/04/aliyun/#comments" itemprop="discussionUrl">
      <span class="post-comments-count valine-comment-count" data-xid="/2020/01/04/aliyun/" itemprop="commentCount"></span>
    </a>
  </span>
  
  
          

          <br>
          

          

          

        </div>
      </header>
    

    
    
    
    <div class="post-body" itemprop="articleBody">

      
      

      
        
          
            <p>   阿里云的主页到处都是广告，非常的花哨，如果好几天不上Aliyun，再上去很容易找不到我的文件存储服务在那里，这里先做个记录，方便日后查阅。</p>
<ol>
<li>当然先做登陆，这个还是能找到的。<br><img src="https://wnnwoo.oss-cn-chengdu.aliyuncs.com/Aliyun/Aliyun-Login.png?x-oss-process=image/resize,p_50" alt="Login"></li>
<li>登陆后找这个bar，点击<strong>控制台</strong>，<br><img src="https://wnnwoo.oss-cn-chengdu.aliyuncs.com/Aliyun/Aliyun-Step1.png?x-oss-process=image/resize,p_50" alt></li>
<li>之后进入控制台页面，寻找<strong>已开通的云产品</strong><br><img src="https://wnnwoo.oss-cn-chengdu.aliyuncs.com/Aliyun/Aliyun-Step2.png" alt></li>
<li>点击<strong>对象存储OSS</strong>，会进入下面的页面，下面页面里有一个“存储空间”<br><img src="https://wnnwoo.oss-cn-chengdu.aliyuncs.com/Aliyun/Aliyun-Step3.png?x-oss-process=image/resize,p_50" alt></li>
<li>点击自己创建的某个<strong>Bucket</strong>，就进入了相关的存储对象的管理页面了，点击 <strong>文件管理</strong> 就可以增加或事删除文件了。<br><img src="https://wnnwoo.oss-cn-chengdu.aliyuncs.com/Aliyun/Aliyun-Step4.png?x-oss-process=image/resize,p_50" alt></li>
<li>关于图片的处理（缩放、裁剪等等），要参考<strong>快速使用图片服务</strong>。<br><img src="https://wnnwoo.oss-cn-chengdu.aliyuncs.com/Aliyun/Aliyun-ImageProceses.png?x-oss-process=image/resize,p_50" alt></li>
</ol>

          
        
      
    </div>

    

    

    
    
    

    

    
      
    
    

    

    <footer class="post-footer">
      

      

      

      
      
        <div class="post-eof"></div>
      
    </footer>
  </div>
  
  
  
  </article>

    
        

  
  
  

  

  <article class="post post-type-normal" itemscope itemtype="http://schema.org/Article">
  
  
  
  <div class="post-block">
    <link itemprop="mainEntityOfPage" href="http://yoursite.com/2019/12/31/bluetooth-past/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="name" content="Wen Wu">
      <meta itemprop="description" content="I'm a bluetooth Host and Controller developer">
      <meta itemprop="image" content="/images/avatar.gif">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="Wen Wu's notes">
    </span>

    
      <header class="post-header">

        
        
          <h1 class="post-title" itemprop="name headline">
                
                
                <a href="/2019/12/31/bluetooth-past/" class="post-title-link" itemprop="url">Periodic Advertising Sync Transfer (PAST)[未完结]</a>
              
            
          </h1>
        

        <div class="post-meta">

          
          
          

          
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              
                <span class="post-meta-item-text">发表于</span>
              

              
                
              

              <time title="创建时间：2019-12-31 23:06:57" itemprop="dateCreated datePublished" datetime="2019-12-31T23:06:57+08:00">2019-12-31</time>
            </span>
          

          

          
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="fa fa-folder-o"></i>
              </span>
              
                <span class="post-meta-item-text">分类于</span>
              
              
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing"><a href="/categories/Bluetooth/" itemprop="url" rel="index"><span itemprop="name">Bluetooth</span></a></span>

                
                
              
            </span>
          

          
          
            <span id="/2019/12/31/bluetooth-past/" class="post-meta-item leancloud_visitors" data-flag-title="Periodic Advertising Sync Transfer (PAST)[未完结]">
              <span class="post-meta-item-icon">
                <i class="fa fa-eye"></i>
              </span>
              
                <span class="post-meta-item-text">阅读次数：</span>
              
                <span class="leancloud-visitors-count"></span>
            </span>
          

          

          
            
  
  <span class="post-meta-item">
    
    <span class="post-meta-item-icon">
      <i class="fa fa-comment-o"></i>
    </span>
    
      <span class="post-meta-item-text">评论数：</span>
    
  
    <a href="/2019/12/31/bluetooth-past/#comments" itemprop="discussionUrl">
      <span class="post-comments-count valine-comment-count" data-xid="/2019/12/31/bluetooth-past/" itemprop="commentCount"></span>
    </a>
  </span>
  
  
          

          <br>
          

          

          

        </div>
      </header>
    

    
    
    
    <div class="post-body" itemprop="articleBody">

      
      

      
        
          
            <p>Periodic Advertising Sync Transfer 是BT 5.1的一个新feature，SIG官网上有一篇文章介绍的还不错<a href="https://www.bluetooth.com/blog/periodic-advertising-sync-transfer/">What You Need to Know About Periodic Advertising Sync Transfer</a>。这里就做一个简单的总结。<br>这个新概念的引入，本质上是为了省电。对于Legacy的advertising，Advertiser在interval附近会加一个Delay（0～10ms），那么Scanner就需要多开窗来抓到adverting 数据包，增加耗电，而PAST概念就是为了在某个场景下可以解决这个问题。<br>先看下几种Advertising的概念</p>
<h2 id="1-Legacy-Advertising"><a href="#1-Legacy-Advertising" class="headerlink" title="1.Legacy Advertising"></a>1.Legacy Advertising</h2><p>Legacy Advertising只在37/38/39三个Channel上打，为了避免adv event刚好跟Scannner的scan window完美错过，在Adv的Interval上会加一个随机值advDalay，让Anchor点随机shift一点点，增加与Scanner的scan window碰撞的几率，示意图如下：<br><img src="https://wnnwoo.oss-cn-chengdu.aliyuncs.com/BT5.1/BT5.1-PAST-LegacyAdv.png" alt="Legacy Adv" title="Legacy advertising"><br>下图为Legacy Adv的PDU的格式：<br><img src="https://wnnwoo.oss-cn-chengdu.aliyuncs.com/BT5.1/LegacyAdvPDUFormat.png?x-oss-process=image/resize,p_50" alt="Legacy Adv"></p>
<h2 id="2-Extended-Advertising"><a href="#2-Extended-Advertising" class="headerlink" title="2.Extended Advertising"></a>2.Extended Advertising</h2><p>Legacy Advertising能发送的Adv data有限，所以后来又衍生出了 extended adv：在Data channel里也可以打Adv data，如下图。<br><img src="https://wnnwoo.oss-cn-chengdu.aliyuncs.com/BT5.1/BT5.1-PAST-ExtAdv.png" alt="Extended Adv" title="Extended advertising"><br>而Extended Advertising引入的概念就比较多了，比如：</p>
<ul>
<li>Advertising Handle，</li>
<li>Advertising Set</li>
<li>Advertising Data ID</li>
<li>…</li>
</ul>
<p>当收到的Adv的type是 ADV_EXT_IND 时，Adv的Payload的数据格式如下：<br><img src="https://wnnwoo.oss-cn-chengdu.aliyuncs.com/BT5.1/ExtAdvPayloadFormat.png?x-oss-process=image/resize,p_50" alt="Payload with ExtendedAdv" title="Payload"><br><img src="https://wnnwoo.oss-cn-chengdu.aliyuncs.com/BT5.1/ExtAdvHeaderFormat.png?x-oss-process=image/resize,p_50" alt="Extended Header format" title="Extended Header"><br><img src="https://wnnwoo.oss-cn-chengdu.aliyuncs.com/BT5.1/ExtAdvHeaderFlags.png?x-oss-process=image/resize,p_50" alt="Extended Adv Header Flags" title="Header Flags"></p>
<h2 id="3-Periodic-Advertising"><a href="#3-Periodic-Advertising" class="headerlink" title="3.Periodic Advertising"></a>3.Periodic Advertising</h2><p>在Extended Advertising的基础上，在发送大量数据的时候又引入了Periodic Advertising。<br>Periodic Advertising 流程的建立有两种方式：</p>
<h3 id="3-1-正常的Scanner-和-Advertiser的交互"><a href="#3-1-正常的Scanner-和-Advertiser的交互" class="headerlink" title="3.1 正常的Scanner 和 Advertiser的交互"></a>3.1 正常的Scanner 和 Advertiser的交互</h3><p>如下图中AoD Transmitter 与 Smartphone的Sync。</p>
<h3 id="3-2-已经有Periodic-Advertising-Synchronization-infomation的一方，将该data通过-LE-C-转发给另外一个跟它连线的设备，就是PAST。"><a href="#3-2-已经有Periodic-Advertising-Synchronization-infomation的一方，将该data通过-LE-C-转发给另外一个跟它连线的设备，就是PAST。" class="headerlink" title="3.2 已经有Periodic Advertising Synchronization infomation的一方，将该data通过 LE-C 转发给另外一个跟它连线的设备，就是PAST。"></a>3.2 已经有Periodic Advertising Synchronization infomation的一方，将该data通过 LE-C 转发给另外一个跟它连线的设备，就是PAST。</h3><p>如下图右图中Smartphone 与Wearable Device之间的关系，Wearable device在前期不需要开Scan去抓ADV_EXT_IND就知道后续要到哪里去收AUX_SYNC_IND包，从而节约了电能。<br><img src="https://wnnwoo.oss-cn-chengdu.aliyuncs.com/BT5.1/BT5.1-PAST-Scenario.png" alt></p>
<h2 id="4-关于PAST的细节："><a href="#4-关于PAST的细节：" class="headerlink" title="4. 关于PAST的细节："></a>4. 关于PAST的细节：</h2><p>下图是Spec中关于Periodic Advertising的一个Sequence flow。<br><img src="https://wnnwoo.oss-cn-chengdu.aliyuncs.com/BT5.1/BT5.1-PeriodicAdv.png?x-oss-process=image/rotate,90" alt="PAST 对比"><br>message 流程图如下：<br>下面三图中A是Scanner，B是Advertiser，A和B中有一个与C有BLE连线，那么会有三种情况：</p>
<h3 id="4-1-A与B建立了Sync，A与C有连线，A通过LL-PERIODIC-SYNC-IND将Sync-information通知给C，那么C就可以收B的Periodic-Sync-advertising。"><a href="#4-1-A与B建立了Sync，A与C有连线，A通过LL-PERIODIC-SYNC-IND将Sync-information通知给C，那么C就可以收B的Periodic-Sync-advertising。" class="headerlink" title="4.1 A与B建立了Sync，A与C有连线，A通过LL_PERIODIC_SYNC_IND将Sync information通知给C，那么C就可以收B的Periodic Sync advertising。"></a>4.1 A与B建立了Sync，A与C有连线，A通过LL_PERIODIC_SYNC_IND将Sync information通知给C，那么C就可以收B的Periodic Sync advertising。</h3><p><img src="https://wnnwoo.oss-cn-chengdu.aliyuncs.com/BT5.1/BT5.1_PAST_MSC_1_Scanner_Report_Disable.png?x-oss-process=image/resize,p_60" alt></p>
<h3 id="4-2-流程同4-1，只是C一开始就Enable了report"><a href="#4-2-流程同4-1，只是C一开始就Enable了report" class="headerlink" title="4.2 流程同4.1，只是C一开始就Enable了report."></a>4.2 流程同4.1，只是C一开始就Enable了report.</h3><p><img src="https://wnnwoo.oss-cn-chengdu.aliyuncs.com/BT5.1/BT5.1_PAST_MSC_1_ScannerTransfer_Report_Enable.png?x-oss-process=image/resize,p_60" alt></p>
<h3 id="4-3-A与B建立Sync，B与C有连线，B通过LL-PERIODIC-SYNC-IND将Sync-information通知给C，那么C就可以收B的Periodic-Sync-Advertising-data了。"><a href="#4-3-A与B建立Sync，B与C有连线，B通过LL-PERIODIC-SYNC-IND将Sync-information通知给C，那么C就可以收B的Periodic-Sync-Advertising-data了。" class="headerlink" title="4.3 A与B建立Sync，B与C有连线，B通过LL_PERIODIC_SYNC_IND将Sync information通知给C，那么C就可以收B的Periodic Sync Advertising data了。"></a>4.3 A与B建立Sync，B与C有连线，B通过LL_PERIODIC_SYNC_IND将Sync information通知给C，那么C就可以收B的Periodic Sync Advertising data了。</h3><p><img src="https://wnnwoo.oss-cn-chengdu.aliyuncs.com/BT5.1/BT5.1_PAST_MSC_1_AdvertiserTransfer_Report_Disable.png?x-oss-process=image/resize,p_80" alt></p>

          
        
      
    </div>

    

    

    
    
    

    

    
      
    
    

    

    <footer class="post-footer">
      

      

      

      
      
        <div class="post-eof"></div>
      
    </footer>
  </div>
  
  
  
  </article>

    
  </section>

  
  <nav class="pagination">
    <a class="extend prev" rel="prev" href="/page/3/"><i class="fa fa-angle-left" aria-label="上一页"></i></a><a class="page-number" href="/">1</a><span class="space">&hellip;</span><a class="page-number" href="/page/3/">3</a><span class="page-number current">4</span><a class="page-number" href="/page/5/">5</a><span class="space">&hellip;</span><a class="page-number" href="/page/8/">8</a><a class="extend next" rel="next" href="/page/5/"><i class="fa fa-angle-right" aria-label="下一页"></i></a>
  </nav>



          </div>
          

        </div>
        
          
  
  <div class="sidebar-toggle">
    <div class="sidebar-toggle-line-wrap">
      <span class="sidebar-toggle-line sidebar-toggle-line-first"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-middle"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-last"></span>
    </div>
  </div>

  <aside id="sidebar" class="sidebar">
    <div class="sidebar-inner">

      

      

      <div class="site-overview-wrap sidebar-panel sidebar-panel-active">
        <div class="site-overview">

          <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
  
  <p class="site-author-name" itemprop="name">Wen Wu</p>
  <div class="site-description motion-element" itemprop="description">I'm a bluetooth Host and Controller developer</div>
</div>


  <nav class="site-state motion-element">
    
      <div class="site-state-item site-state-posts">
        
          <a href="/archives/">
        
          <span class="site-state-item-count">80</span>
          <span class="site-state-item-name">日志</span>
        </a>
      </div>
    

    
      
      
      <div class="site-state-item site-state-categories">
        
          
            <a href="/categories/">
          
        
        
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
        <span class="site-state-item-count">16</span>
        <span class="site-state-item-name">分类</span>
        </a>
      </div>
    

    
      
      
      <div class="site-state-item site-state-tags">
        
          
            <a href="/tags/">
          
        
        
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
        <span class="site-state-item-count">39</span>
        <span class="site-state-item-name">标签</span>
        </a>
      </div>
    
  </nav>













          
          
        </div>
      </div>

      

      

    </div>
  </aside>
  <div id="sidebar-dimmer"></div>


        
      </div>
    </main>

    <footer id="footer" class="footer">
      <div class="footer-inner">
        <div class="copyright">&copy; <span itemprop="copyrightYear">2022</span>
  <span class="with-love" id="animate">
    <i class="fa fa-user"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">Wen Wu</span>

  

  
</div>


  <div class="powered-by">由 <a href="https://hexo.io" class="theme-link" rel="noopener" target="_blank">Hexo</a> 强力驱动 v3.9.0</div>



  <span class="post-meta-divider">|</span>



  <div class="theme-info">主题 – <a href="https://theme-next.org" class="theme-link" rel="noopener" target="_blank">NexT.Gemini</a> v7.2.0</div>





  <script src="https://unpkg.com/mermaid@/dist/mermaid.min.js"></script>
  <script>
    if (window.mermaid) {
      mermaid.initialize("");
    }
  </script>



        








        
      </div>
    </footer>

    
      <div class="back-to-top">
        <i class="fa fa-arrow-up"></i>
        
      </div>
    

    

    

    

  </div>

  

<script>
  if (Object.prototype.toString.call(window.Promise) !== '[object Function]') {
    window.Promise = null;
  }
</script>
















  
  









  
  <script src="/lib/jquery/index.js?v=3.4.1"></script>

  
  <script src="/lib/velocity/velocity.min.js?v=1.2.1"></script>

  
  <script src="/lib/velocity/velocity.ui.min.js?v=1.2.1"></script>




  <script src="/js/utils.js?v=7.2.0"></script>

  <script src="/js/motion.js?v=7.2.0"></script>



  
  


  <script src="/js/affix.js?v=7.2.0"></script>

  <script src="/js/schemes/pisces.js?v=7.2.0"></script>




  

  <script src="/js/next-boot.js?v=7.2.0"></script>

  

  

  


  
  

  
  
    
      
    
      
    
      
    
      
    
      
    
      
    
      
    
      
    
      
    
      
    
  

  























<script>
if ($('body').find('pre.mermaid').length) {
  $.ajax({
    type: 'GET',
    url: '//cdn.jsdelivr.net/npm/mermaid@8/dist/mermaid.min.js',
    dataType: 'script',
    cache: true,
    success: function() {
      mermaid.initialize({
        theme: 'forest',
        logLevel: 3,
        flowchart: { curve: 'linear' },
        gantt: { axisFormat: '%m/%d/%Y' },
        sequence: { actorMargin: 50 }
      });
    }
  });
}
</script>


<script>
// GET RESPONSIVE HEIGHT PASSED FROM IFRAME

window.addEventListener("message", function(e) {
  var data = e.data;
  if ((typeof data === 'string') && (data.indexOf('ciu_embed') > -1)) {
    var featureID = data.split(':')[1];
    var height = data.split(':')[2];
    $(`iframe[data-feature=${featureID}]`).height(parseInt(height) + 30);
  }
}, false);
</script>








  
    

  

<script src="//cdn.jsdelivr.net/npm/valine@1/dist/Valine.min.js"></script>

<script>
  var GUEST = ['nick', 'mail', 'link'];
  var guest = 'nick,mail,link';
  guest = guest.split(',').filter(function(item) {
    return GUEST.indexOf(item) > -1;
  });
  new Valine({
    el: '#comments',
    verify: false,
    notify: false,
    appId: 'wteo2C9GdG6F2N92cktVar8K-gzGzoHsz',
    appKey: 'IBKrtkUwlKqPJ8FQsKkNP0K1',
    placeholder: 'Just go go',
    avatar: 'mm',
    meta: guest,
    pageSize: '10' || 10,
    visitor: true,
    lang: 'zh-cn' || 'zh-cn'
  });
</script><!-- hexo-inject:begin --><!-- Begin: Injected MathJax -->
<script type="text/x-mathjax-config">
  MathJax.Hub.Config({"tex2jax":{"inlineMath":[["$","$"],["\\(","\\)"]],"skipTags":["script","noscript","style","textarea","pre","code"],"processEscapes":true},"TeX":{"equationNumbers":{"autoNumber":"AMS"}}});
</script>

<script type="text/x-mathjax-config">
  MathJax.Hub.Queue(function() {
    var all = MathJax.Hub.getAllJax(), i;
    for(i=0; i < all.length; i += 1) {
      all[i].SourceElement().parentNode.className += ' has-jax';
    }
  });
</script>

<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js">
</script>
<!-- End: Injected MathJax -->
<!-- hexo-inject:end -->

  

</body>
</html>
